import 'package:dio/dio.dart' hide Headers;
import 'package:flutter_book_store/beans/base_entity.dart';
import 'package:flutter_book_store/beans/books_entity.dart';
import 'package:flutter_book_store/beans/login_entity.dart';
import 'package:retrofit/retrofit.dart';

part 'apis.g.dart';

@RestApi()
abstract class RestClient {
  factory RestClient(Dio dio, {String baseUrl}) = _RestClient;

  @GET('/api/admin/find')
  Future<BaseEntiy<BooksEntity>> getBookList(@Query('name') String name,
      @Query('pageNum') int pageNum, @Query('pageSize') int pageSize);

  @POST('/api/login')
  Future<BaseEntiy<LoginEntity>> toLogin(
      @Field('username') String name, @Field('password') String pass);
}
